#!/bin/sh

set -e

OLD_VERSION=$(./xbps-src update-check brave-bin | tail | cut -d ' ' -f1 | rev | cut -d '-' -f1 | rev)
NEW_VERSION=$(./xbps-src update-check brave-bin | tail | cut -d ' ' -f3 | rev | cut -d '-' -f1 | rev)

sed -i "s/$OLD_VERSION/$NEW_VERSION/" srcpkgs/brave-bin/template

xgensum -i brave-bin

./xbps-src pkg brave-bin

xi -y brave-bin
